﻿@model IEnumerable<Citi.Scheduler.WebUi.Models.MachineModel>
@section Menu
{
    @Html.Partial("~/Views/Menu/Entries.cshtml", new ViewDataDictionary())
}
<table class="table table-bordered table-striped">
    <tr>
        <th>
            HostName
        </th>
        <th>
            Status
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.HostName)
            </td>
            <td>@Html.DisplayFor(modelItem => item.Status)
            </td>
            <td>
                @Ajax.ActionLink("Edit", "ActionForm", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "divUpdateMachine", OnBegin = "openUpdateMachineDialog" }, new { @class = "icon-pencil" })
                |
                @Ajax.ActionLink("Delete", "Delete", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "divIndexMachine", Confirm = "Are you sure?" }, new { @class = "icon-remove" })
                |
                @Ajax.ActionLink("See details", "Details", new { id = item.Id }, new AjaxOptions { UpdateTargetId = string.Concat("divDetails", item.Id) }, new { @class = "icon-eye-open" })
                |
                @Ajax.ActionLink("Configuration", "Form", "MachineConfiguration", 
                    new { machineId = item.Id }, 
                    new AjaxOptions { UpdateTargetId = "divUpdateMachineConfiguration", OnBegin = "openUpdateMachineConfigurationDialog" }, new { @class = "icon-cog" })
    
            </td>
        </tr>
        <div id="@string.Concat("divDetails", item.Id)">
        </div>
    }
</table>
